
/*
	测试led_drv.c驱动程序

*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

int main(void)
{
	int fd;
	int on = 0;
	fd = open("/dev/led", O_RDWR);
	if (fd < 0) {
		perror("open");
		exit(1);
	}
	write(fd, &on, sizeof(on));
	read(fd, &on, sizeof(on));
	sleep(2);
	close(fd);
	printf("main exit\n");
	return 0;
}



